<template>
  <el-dialog :visible.sync="dialogVisible" title="供应商详情" width="1000px" @close="handleClose">
    <div class="info_group">
      <div class="info_section" />
      <div class="info_title">基本信息</div>
    </div>
    <el-row v-loading="loading">
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">供应商名称：</span>
        {{ supplierInfo.supplierName }}
      </el-col>
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">联系人名称：</span>
        {{ supplierInfo.contacts }}
      </el-col>
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">手机号：</span>
        {{ supplierInfo.phoneNum }}
      </el-col>
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">邮箱：</span>
        {{ supplierInfo.email }}
      </el-col>
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">传真：</span>
        {{ supplierInfo.fax }}
      </el-col>
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">地址：</span>
        {{ supplierInfo.address }}
      </el-col>
      <el-col :span="12" class="info_content">
        <span style="color: #868d9f">备注：</span>
        {{ supplierInfo.remark }}
      </el-col>
    </el-row>
  </el-dialog>
</template>

<script>
import { supplier_detail } from '@/api/base-data/supplier'

/**
 * @author yizuomin
 * @date 2023/5/7 19:05
 **/
export default {
  name: 'DetailModule',
  props: {
    visible: {
      type: Boolean,
      default() {
        return false
      }
    }
  },
  data() {
    return {
      loading: false,
      dialogVisible: this.visible,
      supplierInfo: {}
    }
  },
  methods: {
    init(supplierId) {
      this.loading = true
      supplier_detail(supplierId).then(resp => {
        if (resp.success) {
          this.supplierInfo = resp.data
        }
      }).finally(() => {
        this.loading = false
      })
    },
    handleClose() {
      this.$emit('close')
    }
  }
}
</script>

<style scoped>

</style>
